<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>登录</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f4f4f4;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      margin: 0;
    }
    .login-container {
      background-color: #fff;
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      width: 300px;
      text-align: center;
    }
    .login-container h2 {
      margin-bottom: 20px;
      color: #333;
    }
    .login-container input[type="text"],
    .login-container input[type="password"] {
      width: 100%;
      padding: 10px;
      margin: 10px 0;
      border: 1px solid #ccc;
      border-radius: 4px;
    }
    .login-container button {
      width: 100%;
      padding: 10px;
      background-color: #28a745;
      border: none;
      border-radius: 4px;
      color: #fff;
      font-size: 16px;
      cursor: pointer;
    }
    .login-container button:hover {
      background-color: #218838;
    }
    .login-container a {
      display: block;
      margin-top: 10px;
      color: #007bff;
      text-decoration: none;
    }
    .login-container a:hover {
      text-decoration: underline;
    }
    .error {
      color: #dc3545;
      margin-top: 10px;
    }
  </style>
</head>
<body>
<div class="login-container">
  <h2>登录</h2>
  <form action="/login" method="post">
    <input type="text" name="username" placeholder="用户名" required />
    <input type="password" name="password" placeholder="密码" required />
    <button type="submit">登录</button>
  </form>
  <a href="/register">注册</a>
  <div class="error" th:if="${error}" th:text="${error}"></div>
</div>
</body>
</html>